/*  1:   */ package org.intellij.plugins.relaxNG.model.annotation;
/*  2:   */ 
/*  3:   */

import com.intellij.psi.xml.XmlFile;
import gnu.trove.TIntArrayList;
import org.intellij.plugins.relaxNG.model.Define;
import org.intellij.plugins.relaxNG.model.Div;
import org.intellij.plugins.relaxNG.model.Grammar;
import org.intellij.plugins.relaxNG.model.Include;

import java.util.List;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */ 
/* 12:   */ class OverriddenDefineSearcher
/* 13:   */   extends CommonElement.Visitor
/* 14:   */ {
/* 15:   */   private final Define a;
/* 16:18 */   private final TIntArrayList b = new TIntArrayList();
/* 17:   */   private final XmlFile c;
/* 18:   */   private final List<Define> d;
/* 19:   */   
/* 20:   */   public OverriddenDefineSearcher(Define paramDefine, XmlFile paramXmlFile, List<Define> paramList)
/* 21:   */   {
/* 22:23 */     this.c = paramXmlFile;
/* 23:24 */     this.d = paramList;
/* 24:25 */     this.a = paramDefine;
/* 25:   */   }
/* 26:   */   
/* 27:   */   public void visitInclude(Include paramInclude)
/* 28:   */   {
/* 29:29 */     this.b.add(paramInclude.getInclude() == this.c ? 1 : 0);
/* 30:   */     try
/* 31:   */     {
/* 32:31 */       paramInclude.acceptChildren(this);
/* 33:   */     }
/* 34:   */     finally
/* 35:   */     {
/* 36:33 */       this.b.remove(this.b.size() - 1);
/* 37:   */     }
/* 38:   */   }
/* 39:   */   
/* 40:   */   public void visitDiv(Div paramDiv)
/* 41:   */   {
/* 42:38 */     paramDiv.acceptChildren(this);
/* 43:   */   }
/* 44:   */   
/* 45:   */   public void visitDefine(Define paramDefine)
/* 46:   */   {
/* 47:42 */     if ((this.b.size() > 0) && (this.b.get(this.b.size() - 1) == 1) && 
/* 48:43 */       (paramDefine.getName().equals(this.a.getName()))) {
/* 49:44 */       this.d.add(paramDefine);
/* 50:   */     }
/* 51:47 */     paramDefine.acceptChildren(this);
/* 52:   */   }
/* 53:   */   
/* 54:   */   public void visitGrammar(Grammar paramGrammar)
/* 55:   */   {
/* 56:51 */     paramGrammar.acceptChildren(this);
/* 57:   */   }
/* 58:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.model.annotation.OverriddenDefineSearcher

 * JD-Core Version:    0.7.0.1

 */